home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctj8403.arc
/
FNKEYS.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1984-01-11
|
2KB
|
89 lines
{ Program to Set Up Function Keys Using
ANSI.SYS Keyboard Driver Under DOS 2.0
Version 840110.1 Pascal IBM PC
Latest 840111
Arthur A. Gleckler
Before this program is used, the ANSI.SYS
keyboard device driver should be installed.
This is done by placing the line
device=ansi.sys
in a file called CONFIG.SYS on the disk
which the computer is booted from. A copy
of the ANSI.SYS program should also be
present on the boot disk.
}
PROGRAM FnKeys;
TYPE
DefString = STRING [20];
PROCEDURE ID;
{ Identify program to user }
BEGIN
WRITE (CHR (27), '[2J');
{ Clear the screen and home cursor }
WRITE ('Program to Set Up Function Keys');
WRITE (' Using ANSI.SYS Keyboard Driver');
WRITELN (' Under DOS 2.0');
WRITELN;
WRITE (' The ANSI.SYS keyboard driver');
WRITE (' must be installed before this');
WRITELN (' program is run.');
WRITELN
END;
PROCEDURE DefineKey (FunctionKey:INTEGER;
NewString:DefString);
{ Sends codes to ANSI.SYS keyboard driver
to redefine a function key; function keys
have extended ASCII codes, with a 0
followed by a number 59-68 for function
keys 1-10, respectively
}
BEGIN
WRITE (CHR (27), '[0;');
WRITE ((FunctionKey + 58):2, ';"');
WRITE (NewString, '";13p')
END;
PROCEDURE SetupKeys;
{ Ask user which key to redefine and what
new definition is
}
VAR Number : INTEGER;
Definition : STRING [20];
BEGIN
REPEAT
WRITE ('Please enter the number');
WRITE (' (1 - 10) of a function');
WRITELN (' key to redefine');
WRITE (' or enter 0 if all key');
WRITELN (' redefinition is complete.');
WRITE ('Function Key Number: ');
READLN (Number);
IF Number IN [1..10]
THEN
BEGIN
WRITE ('Enter definition');
WRITELN (' for F', Number:1, '.');
WRITE ('Definition String: ');
READLN (Definition);
DefineKey (Number, Definition);
WRITE ('F', Number:1, ' = ');
WRITELN (Definition);
WRITELN
END
UNTIL NOT (Number IN [1..10]);
WRITELN;
WRITELN ('Function key setup ended.')
END;
BEGIN
ID;
SetupKeys
END.